<template>
<div>
     <div class="top-images">
          <img src="/static/img/5226.png">
        </div>
    <el-menu theme="dark" default-active="1" class="el-menu-demo" mode="horizontal" :router="true">
     
        <div class="nav-font">
        <el-menu-item index="/elindex/hot">博客首页</el-menu-item>
        <el-menu-item index="3">软件素材</el-menu-item>
        <el-menu-item index="4">站长原创</el-menu-item>
        <el-menu-item index="5">碎言碎语</el-menu-item>
        <el-menu-item index="6">摄影图片</el-menu-item>
        <el-menu-item index="7">旅行日记</el-menu-item>
        <el-menu-item index="8">留言板</el-menu-item>
        <el-menu-item index="9">关于我</el-menu-item>
    </div>
    </el-menu>
    <router-view></router-view>
</div>
</template>


<style lang="less" scoped>
.el-menu-demo{
  max-width: 100%;
  max-height: 10%;
background:#87AF4C;

}
.nav-font{
  max-width: 50%;
  margin: 0 auto;
}
.el-menu-demo *{
  font-weight: bold;
  color: 	#FFF;
  font-size: 15px;
  
}
.top-images{
  max-width: 30%;
  margin-left: 25%;

}
</style>
<script>
export default {
  name: "hello",
  data() {
    return {
      mainShow: true,
      navlist: [],
      role: ''
    };
  },
  computed: {
    active() {
      return this.$store.state.active;
    }
  },
  mounted() {
    this.getsupperInfo();
    this.getPage1();
  },
  methods: {
    async getsupperInfo () {
      let result = await this.$http.get("/super/supperInfo");
      this.role = result.data.name;
      if(this.role =='supper'){
        this.navlist = [
          {
            title: "用户系统",
            url: "",
            icon: "fa fa-user",
            children: [
              // { title: "风控管理", url: "/control" },
              { title: "风控管理", url: "/controlpus" },
              { title: "用户管理", url: "/user" },
              { title: "人气排行管理", url: "/humanqi" },
              { title: "充值排行管理", url: "/rechargesPay" },
              { title: "佣金排行管理", url: "/brokeragePay" }
            ]
          },
          {
            title: "交易系统",
            url: "",
            icon: "fa fa-suitcase",
            children: [
              { title: "期数管理", url: "/stage" },
              { title: "订单管理", url: "/order" },
              // { title: "卡单管理", url: "/failorder" },
              { title: "充值管理", url: "/recharges" },
              { title: "提现管理", url: "/cashs" },
              { title: "充值申请管理", url: "/rechargesIng" },
              // { title: "提现申请管理", url: "/cashsIng" }
            ]
          },
          {
            title: "中心系统",
            url: "",
            icon: "fa fa-cog",
            children: [
              { title: "平台数据管理", url: "/platformData" },
              { title: "公共信息管理", url: "/notice" },
              { title: "域名管理", url: "/realmName" },
              { title: "权限管理", url: "/authority" },
              { title: "设置管理", url: "" }
            ]
          }
        ]
      }else if(this.role =='control'){
        this.navlist = [
          {
            title: "用户系统",
            url: "",
            icon: "fa fa-user",
            children: [
              { title: "风控管理", url: "/control" },
              { title: "用户管理", url: "/user" },
            ]
          },
        ]
      }else if(this.role =='cashs'){
        this.navlist = [
          {
            title: "用户系统",
            url: "",
            icon: "fa fa-user",
            children: [
              { title: "用户管理", url: "/user" }
            ]
          },
          {
            title: "交易系统",
            url: "",
            icon: "fa fa-suitcase",
            children: [
              // { title: "提现申请管理", url: "/cashsIng" },
              { title: "提现管理", url: "/cashs" }
            ]
          }
        ]
      }else if(this.role =='recharge'){
        this.navlist = [
          {
            title: "用户系统",
            url: "",
            icon: "fa fa-user",
            children: [
              { title: "用户管理", url: "/user" }
            ]
          },
          {
            title: "交易系统",
            url: "",
            icon: "fa fa-suitcase",
            children: [
              { title: "充值申请管理", url: "/rechargesIng" },
              { title: "充值管理", url: "/recharges" }
            ]
          }
        ]
      }

    },
    mainShows(){
      if(this.mainShow){
        this.mainShow = false;
      }else{
        this.mainShow = true;
      }
    },
    getPage1(){
      let result = this.$http.get("/index/root")
    },
    async goout() {
      let result = await this.$http.get("/super/goout");
      if (result.data == "1") {
        this.$message({
          message: "退出成功",
          type: "success"
        });
        this.$router.push("/login");
      } else {
        this.$message({
          message: "退出成功",
          type: "warning"
        });
      }
    },
    path(path) {
      this.$router.push({ path: path });
    },
    handleOpen() {},
    handleClose() {}
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
